/**
 * 
 */
package com.thor.palmmall.api.elecharges;

import java.util.Date;

import com.thor.commons.entity.OperateInfo;
import com.thor.commons.exception.ThorServiceException;
import com.thor.commons.query.QueryResult;
import com.thor.commons.query2.QueryDefinition2;
import com.thor.palmmall.rest.elecharges.APayMent;

/**
 * @author NuoSa
 *
 * @since 1.0
 */

public interface EleChargesBillService {

  /** 单号等于 */
  public static final String CONDITION_BILL_NUMBER_EQUALS = "billNumberEquals";
  /** 单号类似于 */
  public static final String CONDITION_BILL_NUMBER_LIKE = "billNumberLike";
  /** 状态在...之中，参数可以是一个或多个状态 */
  public static final String CONDITION_STATE_IN = "stateIn";
  /** 用户编码等于 */
  public static final String CONDITION_USERNUBER_EQUALS = "userNumberEquals";
  /** 回调状态等于 */
  public static final String CONDITION_NOTIFYFLAG_EQUALS = "notifyFlagEquals";

  /** 排序条件: 单号 */
  public static final String ORDER_BY_BILL_NUMBER = "billnumber";
  /** 排序条件: 状态 */
  public static final String ORDER_BY_STATE = "state";
  /** 排序条件: 创建时间 */
  public static final String ORDER_BY_CREATE_TIME = "createTime";

  /**
   * 通过用户号获取用户的用电情况
   * 
   * @throws ThorServiceException
   * 
   */
  public UserEleDate getEleDateByUserId(String userId) throws ThorServiceException;

  /**
   * 创建电费充值单
   * 
   * @throws ThorServiceException
   */
  public String saveEleChargesBill(EleChargesBill eleChargesBill, OperateInfo operateInfo)
      throws ThorServiceException;

  /**
   * 通过id获取电费充值单
   */
  public EleChargesBill getEleChargesBill(String uuid);

  /**
   * 查询电费充值单
   */
  public QueryResult<EleChargesBill> query(QueryDefinition2 definition);

  /**
   * 支付充值单
   */
  public APayMent payEleChargesBill(PayChargesParam param, OperateInfo operateInfo)
      throws ThorServiceException;

  /**
   * 通过编号获取充值单
   */
  public EleChargesBill getByBillNumber(String billNumber);

  /**
   * APP支付成功回调接口
   */
  public void paynotify(String billNumber, String state, OperateInfo operateInfo)
      throws ThorServiceException;

  /**
   * 查询电表的历史数据及倍率信息
   * 
   * @throws ThorServiceException
   * 
   */
  public UserEleDate queryFreezeDataAndCT(String userId, Date date) throws ThorServiceException;

}
